gtk4.git
5 years agoMerge branch 'inspector-list-model' into 'master'
Matthias Clasen [Tue, 30 Jun 2020 22:17:29 +0000 (22:17 +0000)]
Merge branch 'inspector-list-model' into 'master'

Inspector list model support

See merge request GNOME/gtk!2176

5 years agoinspector: Avoid a use of gtk_style_context_add_class
Matthias Clasen [Tue, 30 Jun 2020 21:10:05 +0000 (17:10 -0400)]
inspector: Avoid a use of gtk_style_context_add_class

We have gtk_widget_add_css_class for this now.

5 years agoinspector: proper list model support
Matthias Clasen [Tue, 30 Jun 2020 18:50:01 +0000 (14:50 -0400)]
inspector: proper list model support

Add a data tab for list models that allows exploring
the objects in the model.

5 years agoMerge branch 'wip/on-the-surface-good-fences-can-make-bad-neighbors' into 'master'
Matthias Clasen [Tue, 30 Jun 2020 19:21:45 +0000 (19:21 +0000)]
Merge branch 'wip/on-the-surface-good-fences-can-make-bad-neighbors' into 'master'

x11: Handle window getting unmap while frame still pending

Closes #2902

See merge request GNOME/gtk!2168

5 years agoinspector: Rename DataList -> TreeData
Matthias Clasen [Tue, 30 Jun 2020 19:17:14 +0000 (15:17 -0400)]
inspector: Rename DataList -> TreeData

Rename the DataList object to TreeData, in preparation
for adding a ListData object for list models. While
we are touching it, modernize it a bit (drop the Private
struct, use a layout manager, etc).

5 years agox11: Avoid thawing surface until frame is drawn
Ray Strode [Tue, 30 Jun 2020 18:15:53 +0000 (14:15 -0400)]
x11: Avoid thawing surface until frame is drawn

Since commit 972134abe48a4c9c7b6ad41b0723f30f4e7ae16b a frame getting
drawn has three states (with the vendor nvidia driver at least):

1. drawn by gtk waiting on the GPU
2. drawn by GPU waiting on the compositor
3. drawn by compositor

Those three states are encoded in two flags: frame_pending and
frame_still_painting.

frame_pending means step 1 is done, but step 2 and 3 are still
in progress.  frame_still_painting means step 2 is still in progress.

After step 1 is finished the surface is frozen until step 3 is finished.

When the compositor notifies gtk it's done with step 3, with a
_NET_WM_FRAME_DRAWN client message, the toolkit thaws the surface to
allow the next frame to proceed.

The compositor sometimes sends gtk a _NET_WM_FRAME_DRAWN client message
between steps 1 and 2.  This message should be ignored because it's not
a reply to the current frame.

Unfortunately, gtk currently assumes if it gets a _NET_WM_FRAME_DRAWN
client message while waiting for step 2 that it's actually at step 3,
and proceeds to draw a new frame while the existing frame is still
pending, leading to a blown assertion.

This commit addresses the problem by ignoring _NET_WM_FRAME_DRAWN
client messages from the compositor unless actually expecting one.

Fixes: #2902
5 years agox11: Handle window getting unmapped while frame still pending
Ray Strode [Mon, 29 Jun 2020 14:21:58 +0000 (10:21 -0400)]
x11: Handle window getting unmapped while frame still pending

Since commit 972134abe48a4c9c7b6ad41b0723f30f4e7ae16b we now call
glClientWaitSync for the vendor nvidia driver, to know when a frame
is ready for the compositor to process.

If a surface is hidden while a frame is still being rendered by the GPU,
the surface will never produce the damage event the code relies on to
trigger the call to glClientWaitSync. This leaves the fence dangling,
and the next time the surface is shown, it will start a fresh frame
and blow an assertion since the fence from the last frame is still
hanging around.

This commit ensures a frame gets fully wrapped up before hiding a
surface.

5 years agoinspector: Remove list model support from the property editor
Matthias Clasen [Tue, 30 Jun 2020 18:22:01 +0000 (14:22 -0400)]
inspector: Remove list model support from the property editor

This makes the inspector lock up when used with any production
size list model, and blocks access to properties of the model
itself. Instead, we'll make the model available as an object
and add a data tab for list model contents, like we already
do for tree models.

5 years agoMerge branch 'issue-2904' into 'master'
Matthias Clasen [Tue, 30 Jun 2020 12:03:06 +0000 (12:03 +0000)]
Merge branch 'issue-2904' into 'master'

Add nullable annotations for gtk_cclosure_expression_new()

Closes #2904

See merge request GNOME/gtk!2172

5 years agoAdd nullable annotations for gtk_cclosure_expression_new()
Emmanuele Bassi [Tue, 30 Jun 2020 11:11:21 +0000 (12:11 +0100)]
Add nullable annotations for gtk_cclosure_expression_new()

Fixes: #2904
5 years agogtklistitemfactory: Cosmetic documentation fixes
Matthias Clasen [Tue, 30 Jun 2020 02:08:51 +0000 (22:08 -0400)]
gtklistitemfactory: Cosmetic documentation fixes

5 years agobuilderlistitemfactory: Documentation fixes
Matthias Clasen [Tue, 30 Jun 2020 02:08:21 +0000 (22:08 -0400)]
builderlistitemfactory: Documentation fixes

5 years agoexpression: Add to the docs
Matthias Clasen [Mon, 29 Jun 2020 22:17:00 +0000 (18:17 -0400)]
expression: Add to the docs

Add some more long-form explanation of what expressions
are about and where they are used.

5 years agoDrop GtkFunctionsListItemFactory
Matthias Clasen [Mon, 29 Jun 2020 20:36:46 +0000 (16:36 -0400)]
Drop GtkFunctionsListItemFactory

It has been superseded by GtkSignalsListItemFactory.

5 years agoStop using GtkFunctionsListItemFactory
Matthias Clasen [Mon, 29 Jun 2020 20:37:14 +0000 (16:37 -0400)]
Stop using GtkFunctionsListItemFactory

This was an early attempt at a factory, and has been
superseded by GtkSignalsListItemFactory. Port all users
the the newer one.

5 years agoMerge branch 'wip/Jehan/GtkIMContextWayland-master' into 'master'
Carlos Garnacho [Mon, 29 Jun 2020 22:24:32 +0000 (22:24 +0000)]
Merge branch 'wip/Jehan/GtkIMContextWayland-master' into 'master'

gtk: focus out the GtkIMContextWayland upon finalization.

See merge request GNOME/gtk!2170

5 years agogtk: focus out the GtkIMContextWayland upon finalization.
Jehan [Mon, 29 Jun 2020 20:12:53 +0000 (22:12 +0200)]
gtk: focus out the GtkIMContextWayland upon finalization.

In particular, it will NULL-ified the current global context if this is
the finalized one, avoiding dangling invalid pointers.

Would have been a cherry-pick from branch gtk-3-24 of commit
b592ded80ad4825d115317ba6750a086da0434c0, but files moved.

5 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 29 Jun 2020 14:03:40 +0000 (16:03 +0200)]
Updated Spanish translation

5 years agoMerge branch 'ci-style' into 'master'
Emmanuele Bassi [Mon, 29 Jun 2020 13:45:03 +0000 (13:45 +0000)]
Merge branch 'ci-style' into 'master'

ci: Create new origin for forks

See merge request GNOME/gtk!2164

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Mon, 29 Jun 2020 12:30:41 +0000 (12:30 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #1887

See merge request GNOME/gtk!2167

5 years agoci: Create new origin for forks
Emmanuele Bassi [Sun, 28 Jun 2020 13:01:19 +0000 (14:01 +0100)]
ci: Create new origin for forks

We don't need to create a new remote and fetch its master if we're
checking a merge request done on the upstream repository.

5 years agonode-editor: Add a help window
Matthias Clasen [Mon, 29 Jun 2020 03:47:26 +0000 (23:47 -0400)]
node-editor: Add a help window

Add a Help item to the gear menu that opens the
node-format.md file in a new window. This could
be improved if we could parse markdown and apply
tags, similar to how we can load pango markup.

5 years agonode-editor: Cosmetics
Matthias Clasen [Mon, 29 Jun 2020 03:44:12 +0000 (23:44 -0400)]
node-editor: Cosmetics

Use a title style class for the labels.

5 years agonode-editor: Add a gear menu
Matthias Clasen [Mon, 29 Jun 2020 03:43:13 +0000 (23:43 -0400)]
node-editor: Add a gear menu

Add a gear menu with Inspector and About menu items.

5 years agonode-editor: Document the node format
Matthias Clasen [Mon, 29 Jun 2020 03:38:22 +0000 (23:38 -0400)]
node-editor: Document the node format

Add a markdown file with the documentation of the
node format.

Fixes: #1887
5 years agogtk-demo: Fix binary name in --version
Matthias Clasen [Mon, 29 Jun 2020 03:36:35 +0000 (23:36 -0400)]
gtk-demo: Fix binary name in --version

We are gtk4-demo, not gtk3-demo.

5 years agobitset: Fix documentation syntax
Matthias Clasen [Mon, 29 Jun 2020 02:37:29 +0000 (22:37 -0400)]
bitset: Fix documentation syntax

5 years agobitset: Add more tests
Matthias Clasen [Mon, 29 Jun 2020 01:39:02 +0000 (21:39 -0400)]
bitset: Add more tests

Add some tests for rectangles, and for iters.

5 years agobitset: Correct preconditions in gtk_bitset_add_rectangle
Matthias Clasen [Mon, 29 Jun 2020 01:28:47 +0000 (21:28 -0400)]
bitset: Correct preconditions in gtk_bitset_add_rectangle

We want to make sure that the rectangle fits in the grid.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sun, 28 Jun 2020 23:47:09 +0000 (23:47 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #2743

See merge request GNOME/gtk!2161

5 years agoci: Drop one of the focus tests
Matthias Clasen [Sun, 28 Jun 2020 22:59:48 +0000 (18:59 -0400)]
ci: Drop one of the focus tests

One of the widget-factory focus tests is flaky in ci,
perhaps due to font changes causing size computations
to go slightly differently.

Drop this for now.

5 years agotestsuite: Bump the per-test timeout to 60s
Matthias Clasen [Sun, 28 Jun 2020 21:02:01 +0000 (17:02 -0400)]
testsuite: Bump the per-test timeout to 60s

The bitset test has repeatedly run into the 30s timeout
in the ci, so give it some more time.

5 years agobitset: Fix the right-shift implementation
Matthias Clasen [Sun, 28 Jun 2020 20:36:03 +0000 (16:36 -0400)]
bitset: Fix the right-shift implementation

This was not doing the right thing at all.

This commit also adds tests for left- and
right-shift.

5 years agoStop setting GTK_IM_MODULE_FILE
Matthias Clasen [Sun, 28 Jun 2020 17:08:44 +0000 (13:08 -0400)]
Stop setting GTK_IM_MODULE_FILE

GTK no longer reads this environment variable, so
setting it can have no benefit for uninstalled demos
anymore.

5 years agoAdd g_intern_static_string to valgrind suppressions
Matthias Clasen [Sun, 28 Jun 2020 15:58:25 +0000 (11:58 -0400)]
Add g_intern_static_string to valgrind suppressions

That function can also trigger a quark table reallocation.

5 years agowidget: Avoid uninitialized access
Matthias Clasen [Sun, 28 Jun 2020 15:24:09 +0000 (11:24 -0400)]
widget: Avoid uninitialized access

Initialize all field in the GtkCrossingData struct
when synthesizing crossing events.

Fixes: #2743
5 years agogtk: Better help for GTK_DEBUG
Matthias Clasen [Sun, 28 Jun 2020 03:11:07 +0000 (23:11 -0400)]
gtk: Better help for GTK_DEBUG

Reuse the newly introduced gdk_parse_debug_var for
GTK_DEBUG.

5 years agogsk: Better help for GSK_DEBUG
Matthias Clasen [Sun, 28 Jun 2020 03:09:55 +0000 (23:09 -0400)]
gsk: Better help for GSK_DEBUG

Reuse the newly introduced gdk_parse_debug_var for
GSK_DEBUG.

5 years agogdk: Better help for GDK_DEBUG
Matthias Clasen [Sun, 28 Jun 2020 03:09:07 +0000 (23:09 -0400)]
gdk: Better help for GDK_DEBUG

Include docstrings and format the list of supported
values better.

Also, add the same warning we have for GTK_DEBUG when
the environment variable is ignored.

5 years agotestsuite: Don't pass GDK_DEBUG for release builds
Matthias Clasen [Sun, 28 Jun 2020 15:13:59 +0000 (11:13 -0400)]
testsuite: Don't pass GDK_DEBUG for release builds

The debug env vars are ignored in release builds,
and may spew warnings about that fact that break
tests.

5 years agowayland: Respect GDK_DEBUG=default-settings
Matthias Clasen [Sun, 28 Jun 2020 15:13:07 +0000 (11:13 -0400)]
wayland: Respect GDK_DEBUG=default-settings

You can get this in other ways for Wayland (by
setting GSETTINGS_BACKEND=memory), but it is better
to be consistent across backends.

5 years agoDrop GTK_DEBUG_SHORTCUTS
Matthias Clasen [Sun, 28 Jun 2020 03:19:12 +0000 (23:19 -0400)]
Drop GTK_DEBUG_SHORTCUTS

It is unused.

5 years agoshortcuts: Use GTK_DEBUG_KEYBINDINGS
Matthias Clasen [Sun, 28 Jun 2020 03:14:29 +0000 (23:14 -0400)]
shortcuts: Use GTK_DEBUG_KEYBINDINGS

There was just a single message under GTK_DEBUG_SHORTCUTS.
Consolidate with GTK_DEBUG_KEYBINDINGS.

5 years agodocs: Update environment sections
Matthias Clasen [Sun, 28 Jun 2020 17:41:15 +0000 (13:41 -0400)]
docs: Update environment sections

Fix links in markdown, and add details about
Wayland environment variables.

5 years agoMerge branch 'print-editor' into 'master'
Matthias Clasen [Sun, 28 Jun 2020 16:44:32 +0000 (16:44 +0000)]
Merge branch 'print-editor' into 'master'

Install the print editor

See merge request GNOME/gtk!2165

5 years agostringlist: Cosmetic documentation fix
Matthias Clasen [Sun, 28 Jun 2020 16:41:57 +0000 (12:41 -0400)]
stringlist: Cosmetic documentation fix

5 years agogtk: Add some missing symbols to the docs
Matthias Clasen [Sun, 28 Jun 2020 16:40:41 +0000 (12:40 -0400)]
gtk: Add some missing symbols to the docs

5 years agosorter: Some doc corrections
Matthias Clasen [Sun, 28 Jun 2020 16:39:48 +0000 (12:39 -0400)]
sorter: Some doc corrections

The docs were referring to some non-existing enum value.
Fix things up to match the current code.

5 years agostack: Remove nonexisting api from headers
Matthias Clasen [Sun, 28 Jun 2020 16:33:49 +0000 (12:33 -0400)]
stack: Remove nonexisting api from headers

The homogeneous property was dropped a while ago.

5 years agogdk: Small documentation fixes
Matthias Clasen [Sun, 28 Jun 2020 16:23:08 +0000 (12:23 -0400)]
gdk: Small documentation fixes

Make sure gdk_event_get_seat shows up.

5 years agostack: Cosmetic documentation fixes
Matthias Clasen [Sun, 28 Jun 2020 12:06:17 +0000 (08:06 -0400)]
stack: Cosmetic documentation fixes

Fix parameter mismatches.

5 years agobitset: Cosmetic documentation changes
Matthias Clasen [Sun, 28 Jun 2020 01:53:57 +0000 (21:53 -0400)]
bitset: Cosmetic documentation changes

5 years agoprinteditor: Add desktop file and appdata
Matthias Clasen [Sun, 28 Jun 2020 14:12:45 +0000 (10:12 -0400)]
printeditor: Add desktop file and appdata

All our installed demos have this.

5 years agoprint-editor: Allow opening files
Matthias Clasen [Sun, 28 Jun 2020 14:26:19 +0000 (10:26 -0400)]
print-editor: Allow opening files

Since it calls itself an editor, it should really
support opening files on the commandline.

5 years agoprinteditor: Cosmetics
Matthias Clasen [Sun, 28 Jun 2020 12:33:17 +0000 (08:33 -0400)]
printeditor: Cosmetics

Bring this up to our standards for an installable demo,
by touching up the about dialog and menus.

5 years agoMerge branch 'issue-2900' into 'master'
Emmanuele Bassi [Sun, 28 Jun 2020 13:28:52 +0000 (13:28 +0000)]
Merge branch 'issue-2900' into 'master'

Nullable this_ argument in gtk_expression_bind()

Closes #2900

See merge request GNOME/gtk!2163

5 years agoAdd pre-condition check on nullable argument
Emmanuele Bassi [Sun, 28 Jun 2020 12:40:11 +0000 (13:40 +0100)]
Add pre-condition check on nullable argument

Even if `gtk_expression_watch()` will do the same, we're calling public
API, so we should perform a check at the point of use, to ensure that
warnings are easily debuggable.

5 years agoAnnotate nullable argument
Emmanuele Bassi [Sun, 28 Jun 2020 12:39:17 +0000 (13:39 +0100)]
Annotate nullable argument

The `this_` argument is passed to `gtk_expression_watch()`, which
accepts it as nullable.

Fixes: #2900
5 years agodocs: Remove ancient version information
Matthias Clasen [Sun, 28 Jun 2020 01:46:22 +0000 (21:46 -0400)]
docs: Remove ancient version information

We treat 4.0 as a new era.

5 years agomultiselection: Update docs
Matthias Clasen [Sun, 28 Jun 2020 01:37:28 +0000 (21:37 -0400)]
multiselection: Update docs

Remove information that is no longer true. GtkMultiSelection
is persistent across sorting changes since 3d8b6f6b799499cca02.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 22:19:27 +0000 (22:19 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2160

5 years agodocs: Migration guide additions
Matthias Clasen [Sat, 27 Jun 2020 21:31:22 +0000 (17:31 -0400)]
docs: Migration guide additions

5 years agobuilder: Documentation tweaks
Matthias Clasen [Sat, 27 Jun 2020 21:28:15 +0000 (17:28 -0400)]
builder: Documentation tweaks

Don't use no-longer-existing enums as examples,
and drop the +.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 19:43:18 +0000 (19:43 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2159

5 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Sat, 27 Jun 2020 19:11:12 +0000 (19:11 +0000)]
Update Kazakh translation

5 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Sat, 27 Jun 2020 18:52:16 +0000 (18:52 +0000)]
Update Kazakh translation

5 years agogtk-demo: Drop an unused object
Matthias Clasen [Sat, 27 Jun 2020 13:47:29 +0000 (09:47 -0400)]
gtk-demo: Drop an unused object

The main ui file was still creating a tree store,
but we've switched everything over to use list models.

5 years agobuilder: Warn about dropped objects
Matthias Clasen [Sat, 27 Jun 2020 13:36:45 +0000 (09:36 -0400)]
builder: Warn about dropped objects

Use GTK_DEBUG=builder-objects to make GtkBuilder warn
if a named object from a ui files doesn't get claimed
by gtk_builder_get_object(). This is useful for finding
dead wood in .ui files.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 03:51:21 +0000 (03:51 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #2897 and #2898

See merge request GNOME/gtk!2158

5 years agolistitem: Correct the docs
Matthias Clasen [Sat, 27 Jun 2020 03:07:28 +0000 (23:07 -0400)]
listitem: Correct the docs

5 years agogtk-demo: Improve formatting in the color demo
Matthias Clasen [Sat, 27 Jun 2020 02:57:56 +0000 (22:57 -0400)]
gtk-demo: Improve formatting in the color demo

Properly align and format the numbers in the size
dropdown.

5 years agotext: Support reverse selection
Matthias Clasen [Sat, 27 Jun 2020 02:22:47 +0000 (22:22 -0400)]
text: Support reverse selection

Take ordering of cursor_position and selection_bound
into account when copying text to the clipboard, and
ensure that both orders work the same.

Fixes: #2898
5 years agotext: Update action enabled state correctly
Matthias Clasen [Sat, 27 Jun 2020 02:13:12 +0000 (22:13 -0400)]
text: Update action enabled state correctly

Take the editable property into account when updating
the emoji.insert action state, and update the action
when it changes.

Fixes: #2897
5 years agoshortcutcontroller: Add some debug spew
Matthias Clasen [Sat, 27 Jun 2020 02:12:42 +0000 (22:12 -0400)]
shortcutcontroller: Add some debug spew

This helps in debugging event routing and keyboard
shortcut issues.

5 years agowidget: Fix an oversight
Matthias Clasen [Sat, 27 Jun 2020 02:12:14 +0000 (22:12 -0400)]
widget: Fix an oversight

g_message comes with a builtin newline, don't add one
to the message.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 00:35:51 +0000 (00:35 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Adwaita: Fix block cursors in spinbuttons

Closes #2871

See merge request GNOME/gtk!2156

5 years agoAdwaita: Fix block cursors in spinbuttons
Matthias Clasen [Fri, 26 Jun 2020 23:55:19 +0000 (19:55 -0400)]
Adwaita: Fix block cursors in spinbuttons

Fix block cursors in vertical spinbuttons with Adwaita.

Fixes: #2871
5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 21:14:27 +0000 (21:14 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #2869

See merge request GNOME/gtk!2155

5 years agodocs: Add css docs to entries
Matthias Clasen [Fri, 26 Jun 2020 15:56:27 +0000 (11:56 -0400)]
docs: Add css docs to entries

The various entries were missing the semi-standard
"CSS Nodes" section in their long descriptions. Add
them.

5 years agotext: Be more selective when selecting on focus-in
Matthias Clasen [Fri, 26 Jun 2020 19:49:39 +0000 (15:49 -0400)]
text: Be more selective when selecting on focus-in

We don't want to select on focus-in when the focus
comes from a child. The case where this does harm
is when you activate copy or paste actions from the
context menu. We close the menu before triggering the
action, and if that causes the text in the entry to
be selected, unexpected things happen, since the action
applies to the current selection.

Fixes: #2869
5 years agoRevert "text: Avoid creating a PangoAttrList we don't need"
Matthias Clasen [Fri, 26 Jun 2020 19:27:09 +0000 (15:27 -0400)]
Revert "text: Avoid creating a PangoAttrList we don't need"

This reverts commit 67c26650280ba64ff1c0318be8d848e9563ddb21.

The splicing we do here has the important side-effect
of shifting the preedit attributes to the right position.
Without it, we end up always underlining the first chars
in the entry, regardless where the preedit happens.

5 years agotext: Handle key events in the target phase
Matthias Clasen [Fri, 26 Jun 2020 18:08:35 +0000 (14:08 -0400)]
text: Handle key events in the target phase

This makes sure that we do actual key input right
in the middle between all the capture and bubble
event controllers, and are not dependent on the
ordering of those controllers.

The bug that triggered this change was that the
shortcut for activation (Enter) was getting triggered
before the key input, causing Ctrl-Shift-u hex
to stop working, since it never received the enter
to commit the sequence.

5 years agowidget: Add a debug message for consumed key events
Matthias Clasen [Fri, 26 Jun 2020 18:05:57 +0000 (14:05 -0400)]
widget: Add a debug message for consumed key events

Run the application with GTK_DEBUG=keybindings to
get some hints where key events get lost.

5 years agotext: Give names to event controllers
Matthias Clasen [Fri, 26 Jun 2020 18:05:28 +0000 (14:05 -0400)]
text: Give names to event controllers

It helps with debugging.

5 years agoMerge branch 'wip/carlosg/sequence-state-fixups' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 17:08:09 +0000 (17:08 +0000)]
Merge branch 'wip/carlosg/sequence-state-fixups' into 'master'

Fixups to gesture sequence states

Closes #2895

See merge request GNOME/gtk!2154

5 years agogtktext: Don't accept (twice!) all press actions
Carlos Garnacho [Fri, 26 Jun 2020 15:36:37 +0000 (17:36 +0200)]
gtktext: Don't accept (twice!) all press actions

The gesture should claim the sequence after triggering uncancellable
actions, like pasting, showing a menu or selecting words/lines. A
single first button press initiating a drag does not trigger
anything yet, so it should avoid claiming the sequence.

5 years agogtkswitch: Don't be eager in accepting the gesture
Carlos Garnacho [Fri, 26 Jun 2020 15:35:05 +0000 (17:35 +0200)]
gtkswitch: Don't be eager in accepting the gesture

The gesture should be accepted whenever it triggers uncancellable
actions in the widget. This means it should be accepted if the
click does result in toggling the switch.

This leaves the pan gesture room to handle dragging the handle.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2895
5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 14:31:20 +0000 (14:31 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

main: Avoid a warning

Closes #2894

See merge request GNOME/gtk!2153

5 years agodocs: Some tweaks to the list widget overview
Matthias Clasen [Fri, 26 Jun 2020 13:05:56 +0000 (09:05 -0400)]
docs: Some tweaks to the list widget overview

5 years agoMerge branch 'wip/otte/bitset' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 12:43:49 +0000 (12:43 +0000)]
Merge branch 'wip/otte/bitset' into 'master'

Improve selection handling API for rubberbanding

See merge request GNOME/gtk!2086

5 years agomain: Avoid a warning
Matthias Clasen [Fri, 26 Jun 2020 12:19:32 +0000 (08:19 -0400)]
main: Avoid a warning

transient-for relationships only exist between
windows, so check that both candidates are such.

Fixes: #2894
5 years agoMerge branch 'tintou/dropdown-annotations' into 'master'
Emmanuele Bassi [Fri, 26 Jun 2020 08:48:51 +0000 (08:48 +0000)]
Merge branch 'tintou/dropdown-annotations' into 'master'

dropdown: Annotate the get_selected_item method

See merge request GNOME/gtk!2152

5 years agoMerge branch 'wip/ricotz/annotations' into 'master'
Emmanuele Bassi [Fri, 26 Jun 2020 08:46:35 +0000 (08:46 +0000)]
Merge branch 'wip/ricotz/annotations' into 'master'

gtk: Add some g-i annotations to GtkStringList

See merge request GNOME/gtk!2150

5 years agodropdown: Annotate the get_selected_item method
Corentin Noël [Fri, 26 Jun 2020 07:59:12 +0000 (09:59 +0200)]
dropdown: Annotate the get_selected_item method

We need to specify the type as we already know that it is at least a GObject and in case of no selection, NULL is returned.

5 years agolistbase: Make rubberbanding a threshold drag
Benjamin Otte [Fri, 26 Jun 2020 02:07:35 +0000 (04:07 +0200)]
listbase: Make rubberbanding a threshold drag

5 years agolistbase: Only compute the modifiers when releasing the rubberband
Benjamin Otte [Fri, 26 Jun 2020 01:26:11 +0000 (03:26 +0200)]
listbase: Only compute the modifiers when releasing the rubberband

... and do the right things:

nothing:    selection = rubberband
ctrl:       selection = selection OR rubberband
shift:      selection = selection AND (NOT rubberband)
ctrl+shift: selection = selection XOR rubberband
            (not sure this one makes sense, but toggling is fun)

5 years agolistbase: Compute rubberband region on-demand
Benjamin Otte [Fri, 26 Jun 2020 00:56:38 +0000 (02:56 +0200)]
listbase: Compute rubberband region on-demand

Instead of storing the active items as we go, compute the affected items
whenever the rubberband changes and in particular when the rubberband
ends.
That way, the rubberband is guaranteed to select a rectangle even
after scrolling very far.

This is achieved by having a get_items_in_rect() vfunc that selects all
the items in the rubberbanded rectangle and returns them as a bitset.

5 years agolistview: Allocate rubberband at end of size_allocate()
Benjamin Otte [Fri, 26 Jun 2020 00:55:53 +0000 (02:55 +0200)]
listview: Allocate rubberband at end of size_allocate()

Otherwise the rubberband uses the wrong scroll offsets.

5 years agolistbase: Flip autoscroll deltas if adjustments are flipped
Benjamin Otte [Wed, 24 Jun 2020 03:52:35 +0000 (05:52 +0200)]
listbase: Flip autoscroll deltas if adjustments are flipped

Fixes autoscroll on RTL languages.

5 years agolistbase: Allocate gridview items properly on RTL
Benjamin Otte [Wed, 24 Jun 2020 03:42:38 +0000 (05:42 +0200)]
listbase: Allocate gridview items properly on RTL

We need to flip the items.